import ftplib

ftp = ftplib.FTP("www.python.org")
ftp.login("anonymous", "ftplib-example-1")

print ftp.dir()

ftp.quit()

## total 34
## drwxrwxr-x  11 root     4127         512 Sep 14 14:18 .
## drwxrwxr-x  11 root     4127         512 Sep 14 14:18 ..
## drwxrwxr-x   2 root     4127         512 Sep 13 15:18 RCS
## lrwxrwxrwx   1 root     bin           11 Jun 29 14:34 README -> welcome.msg
## drwxr-xr-x   3 root     wheel        512 May 19  1998 bin
## drwxr-sr-x   3 root     1400         512 Jun  9  1997 dev
## drwxrwxr--   2 root     4127         512 Feb  8  1998 dup
## drwxr-xr-x   3 root     wheel        512 May 19  1998 etc
## ...
